#!/root/bin/php
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
body { background:black; margin:0px; }
a { color:white; font-weight:bold; text-decoration:none; font-family: Verdana, Arial, Helvetica; font-size:0.9em; }
a:active { color: yellow; }
a:hover { color: yellow; }
#logo { font-size:1.2em; font-weight:bold; color: white; margin-right:50px;}
h1 { font-size:0.9em; color: black; vertical-align:top;}
.win { background-color:white; filter:alpha-opacity:0.8;  -moz-opacity:0.8; moz-opacity:0.8; padding:0px;}
td { padding:0em; margin:0em; font-size:0.7em; font-family:verdana;}
textarea, input { width: 300px;} 
textarea 	{ height:50px;}
#map { width:500px; height:300px;}
</style>
<script src="http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
    <script src="http://www.openlayers.org/api/OpenLayers.js"></script>
    <script type="text/javascript">
        var map, layer, velayer;

        function init(){
            map = new OpenLayers.Map('map');

            yahooLayer = new OpenLayers.Layer.Yahoo( "Yahoo");

            map.addLayer(yahooLayer);


            map.setCenter(new OpenLayers.LonLat(<?php system("cat /var/gps_longitude_dd"); ?>,<?php system("cat /var/gps_latitude_dd"); ?>), 14);
            map.addControl(new OpenLayers.Control.LayerSwitcher());
        }
    </script>
</head>
<body onload="init()">
<center>
<table width="70%" cellpadding="5" cellspacing="5" class="win">
<tr><td>
<table width="50%" >
<tr><td>Raw NMEA</td><td><textarea><?php system("cat /var/gps_GP*"); ?></textarea>
<tr><td>Last sample</td><td><input type="text" name="refresh" value="<?php print time()-filemtime("/var/gps_GPRMC"); ?> seconds ago"/></td></tr>
<tr><td>Longitude</td><td><input type="text" name="longitude" value="<?php system("cat /var/gps_longitude"); ?>"/></td></tr>
<tr><td>Latitude</td><td><input type="text" name="latitude" value="<?php system("cat /var/gps_longitude"); ?>"/></td></tr>
<tr><td>Altitude</td><td><input type="text" name="altitude" value="<?php system("cat /var/gps_altitude"); ?>"/></td></tr>        
<tr><td>Speed</td><td><input type="text" name="speed" value="<?php system("cat /var/gps_speed"); ?></td>"/></tr>
<tr><td>Course</td><td><input type="text" name="course" value="<?php system("cat /var/gps_heading"); ?>"/></td></tr>        
<tr><td>Satellites</td><td><input type="text" name="satellites" value="<?php system("cat /var/gps_sats_in_view"); ?>"/></td></tr>
<tr><td>Reperion sync</td><td><textarea><?php system("cat /var/sync_status"); ?></textarea></td></tr>
</table>
</td>
<td>
<div  id="map"></map>
</td>
</table>
</center>
</body>
